package entity;

//@NoArgsConstructor
//@AllArgsConstructor
//@Data
public class ResultData<T>{
    private boolean isSuccess;
    private T data;

    public ResultData() {
    }

    public ResultData(boolean isSuccess, T data) {
        this.isSuccess = isSuccess;
        this.data = data;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    //    public static ResultData success(Object data) {
//        return new ResultData(true, data);
//    }

    public static ResultData fail() {
        return new ResultData(false, "失败");
    }

    public static ResultData fail(String err) {
        return new ResultData(false, err);
    }
}
